[#include "single/layout/layout02/layout.ftl"/]
[@htmlHead]
[/@htmlHead]

[@htmlBody]
<div class="row">
    <ul class="nav nav-tabs">
        <li>
            <a href="${base}/account/view/index">账号列表</a>
        </li>
        [#if "add"==operateType]
            <li class="active"><a href="javascript:void(0)">账号增加</a></li>
        [#else ]
            <li class="active"><a href="javascript:void(0)">账号编辑</a></li>
        [/#if]

    </ul>

    <div class="col-xs-12 ">

        <form class="form-horizontal" action="${base}/account/uc/update" method="post" id="editForm">
            <input type="hidden" name="id" value="${account.id}"/>

            <div class="form-group">
                <label class="col-xs-10 col-sm-4   control-label ">头像</label>

                <div id="uploadImg" class="col-xs-10 col-sm-4 ">
                    <button type="button" class="btn btn-info btn-sm"
                            onclick="component.img.choose('选择图片','userPath','userImg')">
                        选择图片
                    </button>
                    <img id="userImg" src="${account.photo}"
                         style="padding-left: 15px;max-width: 45px;max-height: 35px;"></img>
                    <a id="delBtn"
                       style="[#if employee?has_content&&employee.photo?has_content]display: inline-block;[#else]display: none;[/#if]margin-left: 5px;"
                       href="javascript:void(0)"
                       onclick="delIcon()" class="btn btn-default btn-sm">取消</a>
                    <input id="userPath" name="photo" value="${account.photo}" type="hidden"/>
                </div>
            </div>


            <div id="editAlert" class="" style="min-width:550px"></div>
            <div class="form-group">
                <label class="col-xs-10 col-sm-4  control-label"><span class="required">*</span>名称</label>

                <div class="col-xs-10 col-sm-4 ">
                    <input name="name" value="${account.name}" placeholder="名称"
                           class="form-control input-large"/>
                </div>
            </div>


            <div class="form-group">
                <label class="col-xs-10 col-sm-4  control-label"><span class="required">*</span>登陆名</label>

                <div class="col-xs-10 col-sm-4 ">
                    <input name="loginName" value="${account.loginName}" placeholder="登陆名"
                           class="form-control input-large"/>
                </div>
            </div>

            [#if "add"==operateType]
                <div class="form-group">
                    <label class="col-xs-10 col-sm-4  control-label"><span class="required">*</span>密码</label>

                    <div class="col-xs-10 col-sm-4 ">
                        <input id="password" name="password" type="password" value="" placeholder="密码"
                               class="form-control input-large"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-xs-10 col-sm-4  control-label"><span
                            class="required">*</span>确认密码</label>

                    <div class="col-xs-10 col-sm-4 ">
                        <input name="confirmNewPassword" type="password" value="" placeholder="确认密码"
                               class="form-control input-large"/>
                    </div>
                </div>
            [/#if]


            <div class="form-group">
                <label class="col-xs-10 col-sm-4  control-label">邮箱</label>

                <div class="col-xs-10 col-sm-4 ">
                    <input name="email" value="${account.email}" placeholder="邮箱"
                           class="form-control input-large"/>
                </div>
            </div>


            <div class="form-group">
                <label class="col-xs-10 col-sm-4  control-label">电话</label>

                <div class="col-xs-10 col-sm-4 ">
                    <input name="phone" value="${account.phone}" placeholder="0755-2818133*"
                           class="form-control input-large"/>
                </div>
            </div>


            <div class="form-group">
                <label class=" col-xs-10 col-sm-4  control-label">手机</label>

                <div class="col-xs-10 col-sm-4 ">
                    <input name="mobile" value="${account.mobile}" placeholder="133329195**"
                           class="form-control input-large"/>
                </div>
            </div>


            <div class="form-group">

                <label class="col-xs-10 col-sm-4  control-label">是否启用</label>

                <div class="col-xs-10 col-sm-4 ">
                    <div class="btn-group" role="group">
                        [#if account.isEnabled=='0']
                            <button class="btn btn-sm" type="button" value="1">启用</button>
                            <button class="btn btn-success btn-sm" type="button" value="0">禁用</button>
                            <input type="hidden" name="isEnabled" value="0"/>
                        [#else]
                            <button class="btn  btn-success btn-sm" type="button" value="1">启用</button>
                            <button class="btn btn-sm" type="button" value="0">禁用</button>
                            <input type="hidden" name="isEnabled" value="1"/>
                        [/#if]
                    </div>
                </div>
            </div>


            <div class="form-group">
                <label class=" col-xs-10 col-sm-4  control-label">排序</label>

                <div class="col-xs-10 col-sm-4 ">
                    <input name="sort" value="${account.sort}" placeholder="排序"
                           class="form-control "/>
                </div>
            </div>
        [#--<div class="form-group">--]
        [#--<label class="col-xs-10 col-sm-4  control-label"><span class="required">*</span>所属系统</label>--]

        [#--<div class="col-xs-10 col-sm-4 ">--]
        [#--<div class="input-group input-large">--]
        [#--<input id="appKey" name="appKey" value="${appKey}"--]
        [#--placeholder="系统" readonly--]
        [#--class="form-control "/>--]
        [#--<span class="input-group-btn" onclick="component.app.choose('选择系统','appId','appKey','${account.id}')">--]
        [#--<button type="button" class="btn  blue"><i class="fa fa-search"></i></button>--]
        [#--</span>--]
        [#--<input id="appId" name="appId" value="${appId}" type="hidden"/>--]

        [#--</div>--]
        [#--</div>--]
        [#--</div>--]
            [#--<input type="hidden" name="appKey" value="BOSS"/>--]
            <div class="form-group">
                <label class="col-xs-10 col-sm-4  control-label">描述</label>

                <div class="col-xs-10 col-sm-4 ">
                    <textarea class="form-control input-large" name="description" id="description" cols="80"
                              style="text-align: left;">${account.description}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class=" col-xs-10 col-sm-4  control-label"></label>

                <div class="col-xs-10 col-sm-4 " align="center">
                    <input type="button" class="btn btn-info btn-sm" value="确定" onclick="doSubmit('${operateType}')"/>
                    <input type="button" onclick="tools.goto('${base}/account/view/index')"
                           class="btn btn-cancle btn-sm"
                           value="返回"/>
                </div>
            </div>
        </form>
    </div>
</div>

[/@htmlBody]
[@htmlFoot]
<!--validate-->
    [#include "common/validate.ftl"/]
<script src="${jpath}/assets/public/plugins/dialog/bootbox.js" type="text/javascript"></script>
<script src="${base}/plugins/single/js/module/account/account.js" type="text/javascript"></script>
<script src="${base}/plugins/single/js/module/app/app-component.js" type="text/javascript"></script>
<script src="${base}/plugins/single/js/module/account/uploadFile.js" type="text/javascript"></script>
<script type="text/javascript">
    function delIcon() {
        $("#userImg").attr("src", "");
        $("#userPath").val("");
        $("#delBtn").hide();
    }
    function showDel() {
        $("#delBtn").show();
    }
    function result(data) {
        $.messager.alert0({type: data.code, html: data.message});
    }
</script>
[/@htmlFoot]